package com.cn.wxwinnie.java.datatype;

import java.io.File;
import java.nio.charset.CharsetDecoder;
import java.nio.charset.CharsetEncoder;
import java.util.AbstractMap;
import java.util.AbstractSequentialList;
import java.util.AbstractSet;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.TreeMap;
import java.util.TreeSet;

import javax.servlet.Servlet;
import javax.servlet.http.HttpServlet;


/**
 * @author 吴雄 E-mail:wxwinnie@hotmail.com
 * @version 创建时间：2014年1月7日 上午10:10:09
 * 类说明
 */
public class TestDivision {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		//System.out.println(5/3);
		Object o = null;
		
		CharSequence cs = null;
		IndexOutOfBoundsException iobe = null;
		
		Boolean bl = new Boolean(false);
		Byte by = null;
		Short sh = null;
		Character ch = new Character('a');
		System.out.println("Character 的 HashCode(直接就是assic码)： "  + ch.hashCode());
		
		Integer in = null;
		Float fl= null;
		Long lo = new Long(3);
		Double dou = null;
		System.out.println("hashcode   "+ch.hashCode());
		System.out.println("toString   "+ch.toString());
		
		CharsetEncoder ce = null;
		CharsetDecoder de = null;
		
		Class cdd = null;
		
		boolean bo = true;
		char c ;
		byte b ;
		short s;
		int i ;
		double d;
		float f;
		long l ;
		int ox = 0xfffff;
		
		
		String sss = "sss";
		String.valueOf(bo);   //String 类是个比较棘手的类
		
		Math.random();    //Math 类可以看看 
		
		Date date = new Date();//Date 类可以看看
		
		File fff = null;
		
		Calendar cal = Calendar.getInstance();
		
		//	System.out.println(ox);
		
//		System.out.println("boolean:" + bo);
//		System.out.println("char:" + c);
//		System.out.println("byte:" + b);
//		System.out.println("short:" + s);
//		System.out.println("int:" + i);
//		System.out.println("double:" + d);
//		System.out.println("float:" + f);
//		System.out.println("long:" + l);
		
		//集合泛型
		TreeMap<String, String> tm;
		
		Map<String,String > hmap = new HashMap<String,String >();
		AbstractMap<String, String> am = null;
		
		AbstractSequentialList asl;
		
		List<String> list= new ArrayList<String >();
		
		HashSet<String> set = new HashSet<String>();
		
		TreeSet<String> ts;
		
		Servlet sl ;
		
		HttpServlet hsl;
		
		
		
		StringBuffer sb = new StringBuffer();
		StringBuilder builder= new StringBuilder();
		
		AbstractSet<String> as = null;
		
		hmap.put("", "f");
		hmap.put(null, null);
		hmap.put("", null);
		
		tooString() ;
	}
	
	public static String tooString() {
		Map<String,String > hmap = new HashMap<String,String >();
		hmap.put("String1", "String1");
		hmap.put("String2", "String2");
        Iterator<Entry<String,String>> i =hmap.entrySet().iterator();
        if (! i.hasNext())
            return "{}";
        StringBuilder sb = new StringBuilder();
        sb.append('{');
        while(true) {
            Entry<String,String> e = i.next();
            String key = e.getKey();
            String value = e.getValue();
            sb.append(key);
            sb.append('=');
            sb.append(  value);
            if (! i.hasNext())
                return sb.append('}').toString();
            sb.append(',').append(' ');
        }
    }
}
